import {columnApi} from '@/plugins/api'
// import { columnApi } from '../plugins/api'

const state = () => ({list: []})

const mutations = {
	getColumnList (state, val) {
		state.list = val
	}
}

const actions = {
	async getColumnList ({commit}, val) {
		// 获取栏目
		const { err, data } = await columnApi.getList()
		if (err) {
			return false
		}
		commit('getColumnList', data)
	}
}

export default {namespaced: true, state, mutations, actions}
